package basic_1027;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner scanner=new Scanner(System.in);
		
		String P=scanner.next();
		String A=scanner.next();
		
		scanner.close();
		
		String[] ps=P.split("[.]");
		String[] as=A.split("[.]");
		
		int pKnut=Integer.parseInt(ps[0])*17*29+Integer.parseInt(ps[1])*29+Integer.parseInt(ps[2]);
		int aKnut=Integer.parseInt(as[0])*17*29+Integer.parseInt(as[1])*29+Integer.parseInt(as[2]);
		
		int repayKnut=aKnut-pKnut;
		
		int knut=0,sickle=0,galleon=0;

		knut=repayKnut%29;
		repayKnut/=29;
		sickle=repayKnut%17;
		galleon=repayKnut/17;
		
		if(repayKnut<0) {
			galleon=-Math.abs(galleon);
			sickle=Math.abs(sickle);
			knut=Math.abs(knut);
		}

		System.out.println(galleon+"."+sickle+"."+knut);
		
	}
}
